//
//  PSNodeScore.m
//  PrefCore
//
//  Created by Sergey on 5/15/14.
//  Copyright (c) 2014 Play-on-smart. All rights reserved.
//

#import "PSNodeScore.h"

extern inline uint8_t PSScoreGet(PSPackedScore packed, PSPlayerId player);

extern inline PSPackedScore PSScoreIncrement(PSPackedScore packed, PSPlayerId player);

extern inline BOOL PSScoreIsComplete(PSPackedScore packed);

NSString *PSScoreDescription(PSPackedScore packed) {
    return packed
    ?   [NSString stringWithFormat:@"%1X%1X%1X%s"
        ,   PSScoreGet(packed, 0)
        ,   PSScoreGet(packed, 1)
        ,   PSScoreGet(packed, 2)
        ,   (packed & PS_SCORE_COMPLETE) ? "'" : ""
        ]
    :   @"---";
}
